<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?><!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>文章列表</title>
	<link type="text/css" rel="stylesheet" href="<?php echo base_url() ?>public/css/style.css" />
</head>
<body>

<div class="wrapper">
	<ul class="ul-list">
	</ul>
</div>
<script type="text/javascript" src="<?php echo base_url() ?>public/js/jquery.min.js"></script>
<script type="text/javascript">
/*使用ajax从服务端请求数据并显示数据*/
$.ajax({
	url:'/article/json',
	type : 'get',
	success : function (data) {
		var data = eval('('+data+')');
		window.console && console.log(data);
		var $li = '';
		$.each(data.article,function (i,v) {
			$li += '<li class="li-list"><a href="/article/detail/'+v.aid+'"><span class="s-title">'+v.title+'</span>/<span class="s-time">'+v.time+'</span></a></li>';
		});
		$('.ul-list').html($li);
	}
});
</script>
</body>
</html>